var time;
var m;
var t;
var hour;
var minutes;
chrome.contextMenus.create({
    title: "longgs",
    onclick: function() {
        window.postMessage({
            cmd: 'message',
            data: 'data'
        }, '*');
        chrome.notifications.create(null, {
            type: 'basic',
            iconUrl: 'img/icon.png',
            title: '这是标题',
            message: '您刚才点击了自定义右键菜单logngs！'
        });
    }
});
window.onload = function() {
    setInterval(function() {
        time = new Date(); // 程序计时的月从0开始取值后+1   
        m = time.getMonth() + 1;
        t = time.getFullYear() + "-" + m + "-" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds();
        hour = time.getHours();
        minutes = time.getMinutes();
        if (hour == 8) {
            chrome.notifications.create(null, {
                type: 'image',
                iconUrl:  'img/sds.png',
                 imageUrl: 'img/class.jpg',
                title: '早上打卡',
                message: t
            })
        };
        if (hour == 18)  {
            chrome.notifications.create(null, {
                type: 'image',
                iconUrl:  'img/sds.png',
                 imageUrl: 'img/class.jpg',
                title: '下午打卡',
                message: t
            })
        };
        if (hour == 11 && minutes >= 30)  {
            chrome.notifications.create(null, {
                type: 'image',
                iconUrl:  'img/sds.png',
                 imageUrl: 'img/class.jpg',
                title: '吃饭了！',
                message: t
            })
        };
        if (hour == 15)  {
        	
            chrome.notifications.create(null, {
                type: 'image',
                iconUrl: 'img/sds.png',
                imageUrl: 'img/class.jpg',
                title:'ごきげんよう',
                message: t
            })
        };
    }, 60000);
};